package com.example.text.ui.mall.repository

import androidx.lifecycle.MutableLiveData
import com.example.text.http.ClubService
import com.example.text.ui.mall.model.MallBanner
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

class MallRepository  @Inject constructor(){
    @Inject
    lateinit var mallApiService: ClubService

    /** c端、b端-商城广告、banner，根据终端、区域进行查询 */
    fun cmallAdInfo() = flow {
        //emit(mallApiService.cmallAdInfo(body.toRequestBody()))
        emit(mallApiService.getBannerInfo())
    }

    fun GoodsList() = flow {
        emit(mallApiService.getGoods())
    }

    fun pointGoodsInfo(goodsId:  Long) = flow {
        emit(mallApiService.pointGoodsInfo(goodsId = goodsId))
    }

}